#pragma once
#include "stdafx.h"
#include <vector>
#include "CommandModel.h"

using namespace std;

class DBDao
{

private:
	static vector<CommandModel> histroyCommandCache;

public:
	DBDao(void);
	~DBDao(void);

	void InsertCommand(CString command,CString commandPath);
	void InsertCommand(CommandModel model);
	void UpdateCommandRunCount(CString command);
	void InsertOrUpdateCommand(CString command,CString commandPath);
	void Delete(CString command);
	vector<CommandModel> GetCommandList(CString command = _T(""));
	CommandModel* GetCommand(CString command);
	bool IsCommandExist(CString command);

	void Save();
	void Load();
};

